home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18170 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1002 b 

  1. Path: nntp1.best.com!usenet
  2. From: javaprog@best.com (John Lockwood)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEED HELP WITH ABSOLUTE ADDRESSING
  5. Date: Fri, 19 Apr 1996 04:54:21 GMT
  6. Organization: Best Internet Communications
  7. Message-ID: <4l76ag$ocp@nntp1.best.com>
  8. References: <4l6gnp$38c@janus.cqu.edu.au>
  9. NNTP-Posting-Host: javaprog.vip.best.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Mutchg@Topaz.Cqu.Edu.Au (G.D.Mutch) wrote:
  13.  
  14. >Can Anyone tell me how to assign an absolute address to a variable,
  15. >or get the variable to point to 0x378 ?
  16.  
  17. >I wish to access the 24 bits at the parallel printer port directly.
  18. >and load the data directly. 
  19.  
  20. >I wish to get the compiler to assign 0x378 to the variable address.
  21. > Eg. 
  22.  
  23. Since C++ is typed, you need to cast:
  24.  
  25. int* base = (int *) 0x378;
  26.  
  27. Now that I've loaded the gun for you, I do hope you won't complain to
  28. me if you shoot yourself in the foot with it.  :-)
  29.  
  30.  
  31. John
  32.  
  33.  
  34.  
  35.  
  36. Regards,
  37.  
  38.  
  39.  
  40. John Lockwood
  41. john@wwg.com
  42. javaprog@best.com
  43. http://www.best.com/~javaprog
  44.  
  45.